package com.java.clone;

public class Apple implements Cloneable{
	private String color;
	private double price;
	private AppleType type;

	public String getColor() {
		return color;
	}

	public void setColor(String color) {
		this.color = color;
	}

	public double getPrice() {
		return price;
	}

	public void setPrice(double price) {
		this.price = price;
	}

	public AppleType getType() {
		return type;
	}

	public void setType(AppleType type) {
		this.type = type;
	}

	@Override
	public Object clone() throws CloneNotSupportedException {
		Apple apple2 = (Apple)super.clone();
		AppleType type12 = (AppleType)apple2.getType().clone();
		apple2.setType(type12);
		return apple2;
		//return super.clone();
	}

	@Override
	public String toString() {
		return "Apple{" +
				"color=" + color +
				", price=" + price +
				", type=" + type.getType() +
				'}';
	}

}
